#ifndef ROBOTBASE_H_
#define ROBOTBASE_H_

/*#include <OgreRoot.h>
#include <OgreCamera.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreEntity.h>
#include <OgreWindowEventUtilities.h>

#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>*/

#include "OgreCoreHeaders.h"

#include <Terrain/OgreTerrain.h>
#include <Terrain/OgreTerrainGroup.h>

#include <SdkTrays.h>
#include <SdkCameraMan.h>

class RobotBase :  public Ogre::WindowEventListener, public Ogre::FrameListener,  public OIS::KeyListener, public OIS::MouseListener, OgreBites::SdkTrayListener
{
public:
	RobotBase(void);
	virtual ~RobotBase(void);
	virtual bool go(void);

protected:
	   virtual void windowResized(Ogre::RenderWindow* rw);
		virtual void windowClosed(Ogre::RenderWindow* rw);

		virtual bool setup(void);
		virtual void createCamera(void);
		virtual void createViewport(void);

		virtual void createScene(void)=0;
		virtual void destroyScene(void);

		virtual void startOIS(void);

		virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);
		void getTerrainImage(bool flipX,bool flipY,Ogre::Image& img);

	    virtual bool keyPressed( const OIS::KeyEvent& evt );
	    virtual bool keyReleased( const OIS::KeyEvent& evt );
	    // OIS::MouseListener
	    virtual bool mouseMoved( const OIS::MouseEvent& evt );
	    virtual bool mousePressed( const OIS::MouseEvent& evt, OIS::MouseButtonID id );
	    virtual bool mouseReleased( const OIS::MouseEvent& evt, OIS::MouseButtonID id );

	    virtual void createFrameListener(void);

	    Ogre::Root* mRoot;

	    Ogre::String mPluginsCfg;
	    Ogre::String mResourcesCfg;

	    Ogre::RenderWindow* mWindow;
	    Ogre::SceneManager* mSceneMgr;

	    Ogre::Camera* mCamera;

	    OIS::InputManager* mInputManager;
	    OIS::Mouse* mMouse;
	    OIS::Keyboard* mKeyboard;

		Ogre::TerrainGlobalOptions* mTerrainGlobals;
		Ogre::TerrainGroup* mTerrainGroup;
		bool mTerrainsImported;

		void defineTerrain(long x,long y);
		void initBlendMaps(Ogre::Terrain* terrain);
		void configureTerrainDefaults(Ogre::Light* light);

	    Ogre::Real mRotate;          // The rotate constant
	    Ogre::Real mMove;            // The movement constant
	    Ogre::SceneNode *mCamNode;   // The SceneNode the camera is currently attached to
	    Ogre::Vector3 mDirection;    // Value to move in the correct direction
	    Ogre::Vector3 speed;

	    bool mShutDown;

	    OgreBites::SdkTrayManager* mTrayMgr;
	    OgreBites::ParamsPanel* mDetailsPanel;
	    OgreBites::Label* mInfoLabel;

	    Ogre::Real powerLevel;
		int numPhysSteps;

};


#endif /* ROBOTBASE_H_ */
